// 
// Decompiled by Procyon v0.5.36
// 

package com.orange.boot.environment.service.impl;

import java.util.stream.Collector;
import java.util.stream.Collectors;
import java.util.function.Function;
import java.util.Comparator;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import com.orange.boot.strategy.getEnvironmentContextService;
import org.springframework.stereotype.Service;
import com.orange.boot.environment.service.EnvironmentDataService;
import com.orange.boot.environment.entity.EnvironmentData;
import com.orange.boot.environment.mapper.EnvironmentDataMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

@Service
public class EnvironmentDataServiceImpl extends ServiceImpl<EnvironmentDataMapper, EnvironmentData> implements EnvironmentDataService {
    @Autowired
    private getEnvironmentContextService getEnvironmentContextService;

    public EnvironmentDataServiceImpl() {
    }

    public List<EnvironmentData> getEnvironmentData(String code) {
        List<EnvironmentData> dataList = this.getEnvironmentContextService.generatorEnvironmentContext(code);
        dataList = (List)dataList.stream().sorted(Comparator.comparing(EnvironmentData::getGmtCreate).reversed().reversed()).collect(Collectors.toList());
        return dataList.size() != 0 ? dataList : null;
    }
}
